3.4.6 \(\int \frac {(A+B \log (e (a+b x)^n (c+d x)^{-n}))^2}{g+h x} \, dx\) [306]

3.4.6.1 Optimal result
3.4.6.2 Mathematica [B] (verified)
3.4.6.3 Rubi [A] (warning: unable to verify)
3.4.6.4 Maple [F]
3.4.6.5 Fricas [F]
3.4.6.6 Sympy [F(-2)]
3.4.6.7 Maxima [F]
3.4.6.8 Giac [F]
3.4.6.9 Mupad [F(-1)]

3.4.6.1 Optimal result

Integrand size = 33, antiderivative size = 301 \[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{g+h x} \, dx=-\frac {\log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{h}+\frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \log \left (1-\frac {(d g-c h) (a+b x)}{(b g-a h) (c+d x)}\right )}{h}-\frac {2 B n \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{h}+\frac {2 B n \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \operatorname {PolyLog}\left (2,\frac {(d g-c h) (a+b x)}{(b g-a h) (c+d x)}\right )}{h}+\frac {2 B^2 n^2 \operatorname {PolyLog}\left (3,\frac {d (a+b x)}{b (c+d x)}\right )}{h}-\frac {2 B^2 n^2 \operatorname {PolyLog}\left (3,\frac {(d g-c h) (a+b x)}{(b g-a h) (c+d x)}\right )}{h} \]

output
-ln((-a*d+b*c)/b/(d*x+c))*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2/h+(A+B*ln(e* 
(b*x+a)^n/((d*x+c)^n)))^2*ln(1-(-c*h+d*g)*(b*x+a)/(-a*h+b*g)/(d*x+c))/h-2* 
B*n*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))*polylog(2,d*(b*x+a)/b/(d*x+c))/h+2*B 
*n*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))*polylog(2,(-c*h+d*g)*(b*x+a)/(-a*h+b* 
g)/(d*x+c))/h+2*B^2*n^2*polylog(3,d*(b*x+a)/b/(d*x+c))/h-2*B^2*n^2*polylog 
(3,(-c*h+d*g)*(b*x+a)/(-a*h+b*g)/(d*x+c))/h
 
3.4.6.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(1082\) vs. \(2(301)=602\).

Time = 0.26 (sec) , antiderivative size = 1082, normalized size of antiderivative = 3.59 \[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{g+h x} \, dx=\frac {\left (A+B \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )\right )^2 \log (g+h x)+2 B n \left (A+B \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )\right ) \left (\log (a+b x) \log \left (\frac {b (g+h x)}{b g-a h}\right )+\operatorname {PolyLog}\left (2,\frac {h (a+b x)}{-b g+a h}\right )\right )-2 A B n \left (\log (c+d x) \log \left (\frac {d (g+h x)}{d g-c h}\right )+\operatorname {PolyLog}\left (2,\frac {h (c+d x)}{-d g+c h}\right )\right )-2 B^2 n \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \left (\log (c+d x) \log \left (\frac {d (g+h x)}{d g-c h}\right )+\operatorname {PolyLog}\left (2,\frac {h (c+d x)}{-d g+c h}\right )\right )+B^2 n^2 \left (\log ^2(a+b x) \log \left (\frac {b (g+h x)}{b g-a h}\right )+2 \log (a+b x) \operatorname {PolyLog}\left (2,\frac {h (a+b x)}{-b g+a h}\right )-2 \operatorname {PolyLog}\left (3,\frac {h (a+b x)}{-b g+a h}\right )\right )+B^2 n^2 \left (\log ^2(c+d x) \log \left (\frac {d (g+h x)}{d g-c h}\right )+2 \log (c+d x) \operatorname {PolyLog}\left (2,\frac {h (c+d x)}{-d g+c h}\right )-2 \operatorname {PolyLog}\left (3,\frac {h (c+d x)}{-d g+c h}\right )\right )-2 B^2 n^2 \left (\log (a+b x) \log (c+d x) \log \left (\frac {b (g+h x)}{b g-a h}\right )+\frac {1}{2} \log \left (\frac {h (c+d x)}{-d g+c h}\right ) \left (-2 \log (a+b x)+\log \left (\frac {h (c+d x)}{-d g+c h}\right )\right ) \left (\log \left (\frac {b (g+h x)}{b g-a h}\right )-\log \left (\frac {d (g+h x)}{d g-c h}\right )\right )+\log \left (\frac {h (c+d x)}{-d g+c h}\right ) \log \left (\frac {(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right ) \left (-\log \left (\frac {b (g+h x)}{b g-a h}\right )+\log \left (\frac {d (g+h x)}{d g-c h}\right )\right )+\frac {1}{2} \log ^2\left (\frac {(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right ) \left (\log \left (\frac {-b c+a d}{d (a+b x)}\right )+\log \left (\frac {b (g+h x)}{b g-a h}\right )-\log \left (\frac {(-b c+a d) (g+h x)}{(d g-c h) (a+b x)}\right )\right )+\left (\log (c+d x)-\log \left (\frac {(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )\right ) \operatorname {PolyLog}\left (2,\frac {h (a+b x)}{-b g+a h}\right )+\left (\log (a+b x)+\log \left (\frac {(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )\right ) \operatorname {PolyLog}\left (2,\frac {h (c+d x)}{-d g+c h}\right )+\log \left (\frac {(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right ) \left (\operatorname {PolyLog}\left (2,\frac {b (c+d x)}{d (a+b x)}\right )-\operatorname {PolyLog}\left (2,\frac {(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )\right )-\operatorname {PolyLog}\left (3,\frac {h (a+b x)}{-b g+a h}\right )-\operatorname {PolyLog}\left (3,\frac {h (c+d x)}{-d g+c h}\right )-\operatorname {PolyLog}\left (3,\frac {b (c+d x)}{d (a+b x)}\right )+\operatorname {PolyLog}\left (3,\frac {(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )\right )}{h} \]

input
Integrate[(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2/(g + h*x),x]
 
output
((A + B*(-(n*Log[a + b*x]) + n*Log[c + d*x] + Log[(e*(a + b*x)^n)/(c + d*x 
)^n]))^2*Log[g + h*x] + 2*B*n*(A + B*(-(n*Log[a + b*x]) + n*Log[c + d*x] + 
 Log[(e*(a + b*x)^n)/(c + d*x)^n]))*(Log[a + b*x]*Log[(b*(g + h*x))/(b*g - 
 a*h)] + PolyLog[2, (h*(a + b*x))/(-(b*g) + a*h)]) - 2*A*B*n*(Log[c + d*x] 
*Log[(d*(g + h*x))/(d*g - c*h)] + PolyLog[2, (h*(c + d*x))/(-(d*g) + c*h)] 
) - 2*B^2*n*(-(n*Log[a + b*x]) + n*Log[c + d*x] + Log[(e*(a + b*x)^n)/(c + 
 d*x)^n])*(Log[c + d*x]*Log[(d*(g + h*x))/(d*g - c*h)] + PolyLog[2, (h*(c 
+ d*x))/(-(d*g) + c*h)]) + B^2*n^2*(Log[a + b*x]^2*Log[(b*(g + h*x))/(b*g 
- a*h)] + 2*Log[a + b*x]*PolyLog[2, (h*(a + b*x))/(-(b*g) + a*h)] - 2*Poly 
Log[3, (h*(a + b*x))/(-(b*g) + a*h)]) + B^2*n^2*(Log[c + d*x]^2*Log[(d*(g 
+ h*x))/(d*g - c*h)] + 2*Log[c + d*x]*PolyLog[2, (h*(c + d*x))/(-(d*g) + c 
*h)] - 2*PolyLog[3, (h*(c + d*x))/(-(d*g) + c*h)]) - 2*B^2*n^2*(Log[a + b* 
x]*Log[c + d*x]*Log[(b*(g + h*x))/(b*g - a*h)] + (Log[(h*(c + d*x))/(-(d*g 
) + c*h)]*(-2*Log[a + b*x] + Log[(h*(c + d*x))/(-(d*g) + c*h)])*(Log[(b*(g 
 + h*x))/(b*g - a*h)] - Log[(d*(g + h*x))/(d*g - c*h)]))/2 + Log[(h*(c + d 
*x))/(-(d*g) + c*h)]*Log[((b*g - a*h)*(c + d*x))/((d*g - c*h)*(a + b*x))]* 
(-Log[(b*(g + h*x))/(b*g - a*h)] + Log[(d*(g + h*x))/(d*g - c*h)]) + (Log[ 
((b*g - a*h)*(c + d*x))/((d*g - c*h)*(a + b*x))]^2*(Log[(-(b*c) + a*d)/(d* 
(a + b*x))] + Log[(b*(g + h*x))/(b*g - a*h)] - Log[((-(b*c) + a*d)*(g + h* 
x))/((d*g - c*h)*(a + b*x))]))/2 + (Log[c + d*x] - Log[((b*g - a*h)*(c ...
 
3.4.6.3 Rubi [A] (warning: unable to verify)

Time = 0.78 (sec) , antiderivative size = 367, normalized size of antiderivative = 1.22, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {2973, 2953, 2804, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{g+h x} \, dx\)

\(\Big \downarrow \) 2973

\(\displaystyle \int \frac {\left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{g+h x}dx\)

\(\Big \downarrow \) 2953

\(\displaystyle (b c-a d) \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{\left (b-\frac {d (a+b x)}{c+d x}\right ) \left (b g-a h-\frac {(d g-c h) (a+b x)}{c+d x}\right )}d\frac {a+b x}{c+d x}\)

\(\Big \downarrow \) 2804

\(\displaystyle (b c-a d) \int \left (\frac {d \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b c-a d) h \left (b-\frac {d (a+b x)}{c+d x}\right )}+\frac {(c h-d g) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b c-a d) h \left (b g-a h-\frac {(d g-c h) (a+b x)}{c+d x}\right )}\right )d\frac {a+b x}{c+d x}\)

\(\Big \downarrow \) 2009

\(\displaystyle (b c-a d) \left (\frac {2 B n \operatorname {PolyLog}\left (2,\frac {(d g-c h) (a+b x)}{(b g-a h) (c+d x)}\right ) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{h (b c-a d)}+\frac {\log \left (1-\frac {(a+b x) (d g-c h)}{(c+d x) (b g-a h)}\right ) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{h (b c-a d)}-\frac {2 B n \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right ) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{h (b c-a d)}-\frac {\log \left (1-\frac {d (a+b x)}{b (c+d x)}\right ) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{h (b c-a d)}-\frac {2 B^2 n^2 \operatorname {PolyLog}\left (3,\frac {(d g-c h) (a+b x)}{(b g-a h) (c+d x)}\right )}{h (b c-a d)}+\frac {2 B^2 n^2 \operatorname {PolyLog}\left (3,\frac {d (a+b x)}{b (c+d x)}\right )}{h (b c-a d)}\right )\)

input
Int[(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2/(g + h*x),x]
 
output
(b*c - a*d)*(-(((A + B*Log[e*((a + b*x)/(c + d*x))^n])^2*Log[1 - (d*(a + b 
*x))/(b*(c + d*x))])/((b*c - a*d)*h)) + ((A + B*Log[e*((a + b*x)/(c + d*x) 
)^n])^2*Log[1 - ((d*g - c*h)*(a + b*x))/((b*g - a*h)*(c + d*x))])/((b*c - 
a*d)*h) - (2*B*n*(A + B*Log[e*((a + b*x)/(c + d*x))^n])*PolyLog[2, (d*(a + 
 b*x))/(b*(c + d*x))])/((b*c - a*d)*h) + (2*B*n*(A + B*Log[e*((a + b*x)/(c 
 + d*x))^n])*PolyLog[2, ((d*g - c*h)*(a + b*x))/((b*g - a*h)*(c + d*x))])/ 
((b*c - a*d)*h) + (2*B^2*n^2*PolyLog[3, (d*(a + b*x))/(b*(c + d*x))])/((b* 
c - a*d)*h) - (2*B^2*n^2*PolyLog[3, ((d*g - c*h)*(a + b*x))/((b*g - a*h)*( 
c + d*x))])/((b*c - a*d)*h))
 

3.4.6.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2804
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{ 
u = ExpandIntegrand[(a + b*Log[c*x^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] / 
; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]
 

rule 2953
Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*( 
B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(b*c - a*d)   Sub 
st[Int[(b*f - a*g - (d*f - c*g)*x)^m*((A + B*Log[e*x^n])^p/(b - d*x)^(m + 2 
)), x], x, (a + b*x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n} 
, x] && NeQ[b*c - a*d, 0] && IntegerQ[m] && IGtQ[p, 0]
 

rule 2973
Int[((A_.) + Log[(e_.)*(u_)^(n_.)*(v_)^(mn_)]*(B_.))^(p_.)*(w_.), x_Symbol] 
 :> Subst[Int[w*(A + B*Log[e*(u/v)^n])^p, x], e*(u/v)^n, e*(u^n/v^n)] /; Fr 
eeQ[{e, A, B, n, p}, x] && EqQ[n + mn, 0] && LinearQ[{u, v}, x] &&  !Intege 
rQ[n]
 
3.4.6.4 Maple [F]

\[\int \frac {{\left (A +B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right )\right )}^{2}}{h x +g}d x\]

input
int((A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2/(h*x+g),x)
 
output
int((A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2/(h*x+g),x)
 
3.4.6.5 Fricas [F]

\[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{g+h x} \, dx=\int { \frac {{\left (B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2}}{h x + g} \,d x } \]

input
integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2/(h*x+g),x, algorithm="frica 
s")
 
output
integral((B^2*log((b*x + a)^n*e/(d*x + c)^n)^2 + 2*A*B*log((b*x + a)^n*e/( 
d*x + c)^n) + A^2)/(h*x + g), x)
 
3.4.6.6 Sympy [F(-2)]

Exception generated. \[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{g+h x} \, dx=\text {Exception raised: HeuristicGCDFailed} \]

input
integrate((A+B*ln(e*(b*x+a)**n/((d*x+c)**n)))**2/(h*x+g),x)
 
output
Exception raised: HeuristicGCDFailed >> no luck
 
3.4.6.7 Maxima [F]

\[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{g+h x} \, dx=\int { \frac {{\left (B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2}}{h x + g} \,d x } \]

input
integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2/(h*x+g),x, algorithm="maxim 
a")
 
output
A^2*log(h*x + g)/h + integrate((B^2*log((b*x + a)^n)^2 + B^2*log((d*x + c) 
^n)^2 + B^2*log(e)^2 + 2*A*B*log(e) + 2*(B^2*log(e) + A*B)*log((b*x + a)^n 
) - 2*(B^2*log((b*x + a)^n) + B^2*log(e) + A*B)*log((d*x + c)^n))/(h*x + g 
), x)
 
3.4.6.8 Giac [F]

\[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{g+h x} \, dx=\int { \frac {{\left (B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2}}{h x + g} \,d x } \]

input
integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2/(h*x+g),x, algorithm="giac" 
)
 
output
integrate((B*log((b*x + a)^n*e/(d*x + c)^n) + A)^2/(h*x + g), x)
 
3.4.6.9 Mupad [F(-1)]

Timed out. \[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{g+h x} \, dx=\int \frac {{\left (A+B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\right )}^2}{g+h\,x} \,d x \]

input
int((A + B*log((e*(a + b*x)^n)/(c + d*x)^n))^2/(g + h*x),x)
 
output
int((A + B*log((e*(a + b*x)^n)/(c + d*x)^n))^2/(g + h*x), x)